<?php
/**
 * Abstract model for SQL UPDATE query
 */
abstract class SQLUpdate {
	protected $strTableName;
	protected $objUpdates;
	protected $objConditions;

	/**
	 * Sets table name directly from constructor.
	 *
	 * @param string $strTableName
	 */
	public function __construct($strTableName) {
		$this->strTableName = $strTableName;
	}
	
	/**
	 * Sets SET clause for query.
	 * 
	 * @param SQLUpdatesClause $objSQLUpdateClause
	 * @return SQLUpdate
	 */
	public function setUpdates($objSQLUpdateClause) {
		$this->objUpdates = $objSQLUpdateClause;
		return $this;
	}
	
	/**
	 * Sets WHERE clause for query.
	 * 
	 * @param SQLConditionsClause $objSQLConditionsClause
	 * @return SQLUpdate
	 */
	public function setConditions($objSQLConditionsClause) {
		$this->objConditions = $objSQLConditionsClause;
		return $this;
	}
	
	abstract public function toString();
}